package LCR剑指.LCR079;

import java.util.*;

class Solution {

    private List<List<Integer>> res = new ArrayList<List<Integer>>();

    public List<List<Integer>> subsets(int[] nums) {
        res.add(new ArrayList<>());
        backTrack(nums,new ArrayList<>(),0);
        return res;
    }

    private void backTrack(int[] nums,List<Integer> currRes,int cur) {
        //终止条件
        if(cur == nums.length) {
            return;
        }
        currRes.add(nums[cur]);
        res.add(new ArrayList<>(currRes));
        backTrack(nums,currRes,cur+1);
        currRes.remove(currRes.size()-1);
        backTrack(nums,currRes,cur+1);

    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        solution.subsets(new int[]{0});
        System.out.printf("");
    }
}